using UnityEngine;
using System.Collections;

public class SetTargetRotationOnDirection : CharacterAction
{  
	public override void OnActionEnter (Character character)
	{
		character.onDirectionCommand.OnEvent += OnDirectionCommand;
	}
	
	public override void OnActionExit (Character character)
	{
		character.onDirectionCommand.OnEvent -= OnDirectionCommand;
	}

	public void OnDirectionCommand (Character.DirectionCommand arg)
	{
		arg.character.targetRotation = arg.direction; 
	}
}

